"""
面向对象 继承
"""


class Phone:
    __id: int = None

    def call_by_number(self, num):
        print(f"call someone num: {num}")


class IPhone(Phone):
    # 变量名: 类型
    system: str = "MAC"

    # 复写父类方法
    def call_by_number(self, num: int):
        # 调用父类方法
        super().call_by_number(num)
        print(f"{self.system} call someone num: {num}")

    # 返回值类型注解
    def phone_name(self) -> str:
        return self.system


if __name__ == '__main__':
    p = IPhone()
    p.call_by_number(num=123)
